/* $Id: MapPropertiesDialogFactory.java 63 2010-02-14 13:52:34Z aaron.day $ */
package org.crazydays.gameplan.map.swing;


import org.crazydays.gameplan.map.GameMap;
import org.crazydays.gameplan.view.View;

/**
 * MapPropertiesDialog
 */
public class MapPropertiesDialogFactory
{
    /** view */
    protected View view;

    /**
     * Set view.
     * 
     * @param view View
     */
    public void setView(View view)
    {
        this.view = view;
    }

    /**
     * Build map properties dialog.
     * 
     * @param gameMap GameMap
     * @return JMapPropertiesDialog
     */
    public JMapPropertiesDialog buildMapPropertiesDialog(GameMap gameMap)
    {
        if (gameMap == null) {
            throw new IllegalArgumentException("gameMap == null");
        }

        JMapPropertiesDialog dialog = new JMapPropertiesDialog(view, gameMap);
        dialog.initialize();

        return dialog;
    }
}
